Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 6.2 QJSEngine meyatype converter #8

Open
wants to merge 6,430 commits into
base: dev
Choose a base branch
from
Open

Qt 6.2 QJSEngine meyatype converter #8

wants to merge 6,430 commits into from

Conversation

rjcamatos
Copy link

It was Nice to be able to register a meyatype converter and the QJSEngine convert for that object to a data type.
Until now i create a class of QIcon and add and invokable method that returns *this.
Like that i can recive on c++ a QIcon as reference
Is there something that Im missing?
If i create a object in c++ with QJSEngine::toScriptVale of a QIcon it works as well but like that i canto create a new object of that type and if i Change the value it chances for all c++ calls, in JavaScript is nota trivial to clone a object it was Nice to be able to clone it and fonte destroy the Last calls.

aavit and others added 30 commits December 8, 2022 09:22
By default, border widths are rounded to integer values (in
QSGBasicInternalRectangleNode::updateGeometry()), so one avoids
artifacts where the rendered width can fluctuate with one pixel if the
Rectangle coordinates are fractional. However, that rounding was done
before the device pixel ratio scaling, so if the dpr was fractional,
one would get a fractional rendered border width, and hence
fluctuations.

Fix by taking the dpr into account. The rounding is done in the Item,
where the dpr is known, instead of the SG Node.

Fixes: QTBUG-108831
Change-Id: I9a1d8180c72dd5e1b1eaa9f1c420eb9944f1e5a5
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 73a3b69)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
When scaling with fractional values, aliasing can occur. Use the same
approach as BorderImage and respect the smooth property of
NinePatchImage. This property comes from QQuickImageBase, which sets it
to true by default. We change QQuickNinePatchImage's default value for
it to false, but this can be overridden by setting
QT_QUICK_CONTROLS_IMAGINE_SMOOTH to 1.

As NinePatchImage is not public API, and users would have to set the
smooth property on every image (where some items contain multiple
NinePatchImages), it's better to have one place to set this for all
controls.

[ChangeLog][Controls] The Imagine style now supports smooth scaling for
9-patch images when the QT_QUICK_CONTROLS_IMAGINE_SMOOTH environment
variable is set to 1.

Fixes: QTBUG-107989
Change-Id: I250a041f87c0270d67af191168f7bcfbf6237925
Reviewed-by: Richard Moe Gustavsen <[email protected]>
(cherry picked from commit 649151b)
Reviewed-by: Paul Wicking <[email protected]>
…in C++23)

... by rolling our own.

Qt 5.15 uses a pointer (additional indirection), not aligned_storage,
so isn't affected.

References:
- cplusplus/papers#197
- https://wg21.link/p1413

Manual conflict resolutions:
- adapted to different member names and private/public access in the
  6.2 class vis-a-vis the 6.4+ version.

Task-number: QTBUG-99122
Change-Id: Ia116dc11336901a19fc227fb68ac266c1bfbbcb1
Reviewed-by: Fabian Kosmale <[email protected]>
(cherry picked from commit 6e9a9ed)
Reviewed-by: Qt CI Bot <[email protected]>
Change-Id: Ia8761ba9c2894e1eb534c479d55e2dfd10ecc2b1
Reviewed-by: Tarja Sundqvist <[email protected]>
Change-Id: I0231f2f00db9a6f6593a9e33e7eb35501c648b0b
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Fixes: QTBUG-107492
Change-Id: I3f5ad0421bbd0822c76c5e32e42616461cde31c3
Reviewed-by: Leena Miettinen <[email protected]>
(cherry picked from commit 39e584f)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
...for source files that are outside of the source directory.

Having QML files that are generated in the build directory led
to *_qmlcache.cpp files with very long file names, hitting file system
limitations on Windows.

Apply the same fix that was done for generated qmlcache.qrc files in
commit 5d7710a.

Task-number: QTBUG-108150
Change-Id: Icef9dbf40fc7ade54b584bcdc8799c4cc95ac76d
Reviewed-by: Alexandru Croitor <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
(cherry picked from commit e4feab1)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Change-Id: Icb82ba585486d19afbb324e02ecf04658ba9c0fe
Reviewed-by: Qt Submodule Update Bot <[email protected]>
tst_qquickimageparticle::test_tabled is crashing randomly
whit Ubuntu 22.04

Task-number: QTBUG-107707
Change-Id: I43d00e0d66c867355d0dd52b001ee0c347bc0ce2
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
(cherry picked from commit 29e3458)
It's the [set]sceneGraphBackend() functions that are from 5.8, the new
functions in Qt 6 are since 6.0.

Change-Id: If36f42615d53bd964f05ba42846b9322d8f1a0e4
Reviewed-by: Christian Strømme <[email protected]>
(cherry picked from commit 848f40f)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
It was possible to call c++-methods (either invokable or as slot) with
wrong arguments, which caused a crash.
The reason was that CallMethod(...) converted something to a QObject
without checking if it was an actual QObject. The wrongly typed argument
would end up reinterpret_cast'ed into another type for the call, which
leads to segmentation fault when accessing the argument in the function.

Added a test where an int tried to be reinterpret-cast'ed into a QFont.

Fixes: QTBUG-108994
Change-Id: I8c45c9124411ad3fd100faed0b03390843f7d034
Reviewed-by: Ulf Hermann <[email protected]>
(cherry picked from commit cda417c)
… attribute more prominent

Task-number: PYSIDE-1345
Change-Id: I765e32d367c36add97a08c03df5e0ac30e92e56e
Reviewed-by: Laszlo Agocs <[email protected]>
(cherry picked from commit c6e294f)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
A parent that filters mouse/touch events for a child might make the
child the exclusive grabber of the touch point when filtering, and the
child might have the keepTouchGrab property set. In that case, don't
override the exclusive grabber with the filtering parent.

Task-number: QTBUG-105312
Change-Id: Ic04513987d5ecb2cd0b12939b7d66091e85b35ee
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit f15f1d6)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
This broke in 80166d5,
so to ensure that doesn't happen again, add a test that is expected
to fail until the issue is fixed.

Task-number: QTBUG-105312
Change-Id: I70462304b5bf74c58420632a7e512be8d7cbb817
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit b31d4dc)
Amend 80166d5, which broke touch event
handling in SplitView. Implement handling of TouchBegin/Update/End
events equivalently to the mouse event handling.

As a drive-by, rename the logging category from 'mouse' to 'pointer',
and refactor the if/else sequence to a switch statement, reducing
duplication of code that's common for all event types.

Remove expectFail from the test that now passes.

Fixes: QTBUG-105312
Change-Id: I156f55fa40b2afaaa115e59940d26187121fc16a
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 6de2397)
Reviewed-by: Volker Hilsheimer <[email protected]>
The attached ListView.isCurrentItem property is updated when
QQuickItemViewPrivate::updateCurrent() method is called.
During the initialization it could be potentially called twice:
* from the QQuickItemView::setCurrentIndex() method, but that does
  not happen, because the isComponentCompleted() condition is not
  fulfilled at that time.
* from QQuickItemView::componentComplete() method, but that does
  not happen, because the d->isValid() condition is not fulfilled.
  The latter means that the model is not yet initialized.

This patch attempts to fix it by adding the updateCurrent() call
into layout() method. This method is called each time the
component needs to be redrawn, so it creates the proper
currentItem during the first call. Most of the subsequent calls
will do nothing, because the currentItem will be non-null, and
the currentIndex will not change.

The unit-test is taken from the reverted commit
d9f9d77.

Another unit-test is meant to check that there is no regression
like in QTBUG-98315.

Done-with: Joni Poikelin <[email protected]>
Fixes: QTBUG-86744
Change-Id: Iab86a9c0e22660126f152727e8bd393ac17f5d15
Reviewed-by: Mitch Curtis <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 9124fce)
Reviewed-by: Ivan Solovev <[email protected]>
If the Drawer does not cover the whole window, it's possible to tap
outside the dimmer overlay. In that case, next time you tap on the
dimmer, you hit this early return in handleRelease in which
pressPoint.isNull(), so it was not setting touchId back to -1 and doing
the other cleanup/reset tasks.  This is a touch release, and touchId
should always be eventually reset after a touch release, regardless of
the code path.

Now QQuickDrawerPrivate::handleRelease() has a QScopeGuard to ensure
that cleanup is done regardless of early returns. That's still not
enough; but when we receive TouchEnd in QPopupPriv::handleTouchEvent(),
it means that _all_ touchpoints are released. So as a fallback for
multi-touch cases, we now ensure that all releases are handled and
stored state is reset, regardless of whether an individual point ID
matches the stored touchId.

Fixes: QTBUG-103811
Change-Id: Ia637bae00d8edb7f7f4c8fb4337b4c3d72fe4e60
Reviewed-by: Doris Verria <[email protected]>
(cherry picked from commit 730cdc5)
Reviewed-by: Mitch Curtis <[email protected]>
A previous patch 5647527 causes
a regression. The purpose of the patch, that caused this regression,
was to update the pressPos variables, in cases where the contentItem's
geometry was modified externally, while a user were dragging the
contentItem around.

The mistake that was made, was how width and height changes were
handled. We had previously added logic in setContentWidth() and
setContentHeight() that would call fixup() (with immediate fixupMode)
to ensure that the contentItem would immediately be repositioned
inside the flickable's viewport, if the contentItem was being dragged.

It turns out that setContentWidth() and setContentHeight() are being
called from QQuickItemViewPrivate::updateViewport(), which happens
quite often, while dragging. This would make fixup() and dragging
constantly interfere with each other, since they'd not always agree on
a specific position for the contentItem.

This patch reverts the changes made to setContentWidth() and
setContentHeight(), since it turns out that those changes weren't
necessary after all. QQuickFlickablePrivate::itemGeometryChanged() only
calls viewportMoved() on x and y changes anyways.

Done-with: Jan Arve Sæther <[email protected]>
Done-with: Santhosh Kumar Selvaraj <[email protected]>
Fixes: QTBUG-109140
Change-Id: I0bddf8685d3afc1ae04b2c092212d3c1bd742c3b
Reviewed-by: Paul Wicking <[email protected]>
(cherry picked from commit b307bf3)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Change-Id: I862a5809107914aa5b3dc30fe8bebdcbc16903b8
Reviewed-by: Qt Submodule Update Bot <[email protected]>
When we look up glyphs with subpixel positions in the glyph cache,
we use the calculated subpixel position (from a set of predefined
subpixel positions) as key. In some very rare cases, we could end
up with different subpixel positions when looking up an on-screen
position than when we entered it into the cache, due to numerical
differences when doing the calculation.

The reason for this was that when entering the glyph into the
cache, we used the 16.6 fixed point representation, whereas when
looking up, we used the unmodified float. In some cases, the
converted fixed point approximation might snap to a different
predefined subpixel position than the floating point equivalent.

To avoid this, we reuse the converted fixed point positions when
looking up the glyphs in the cache.

[ChangeLog][Text] Fixed an issue where text using NativeRendering
would sometimes be missing glyphs.

Fixes: QTBUG-108713
Change-Id: Iecc264eb3d27e875c24257eaefcfb18a1a5fb5be
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
(cherry picked from commit 4bad329)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Fixed a bug where QQuickPopupPositioner::reposition() was confusing
coordinates obtained by mapToSource() and mapToItem() during mirroring
of the popup. This leads to popups at the wrong places, e.g. when a
rotated combobox has not enough space to unroll its popup.

Translate the coordinates using mapToItem instead of mapToSource after
computing the alternative position of the popup (e.g. when it can not
be unrolled correctly).

Add a test to check if the combobox popup appears at the right places.
Skip native styles as they might be pushing the popup around, same
for Android as they might have too small screens (which involves
more positioning logic then just the mirroring).

Fixes: QTBUG-105148
Change-Id: I0033509a8824e3a71698f91ef832b94527d8e2c8
Reviewed-by: Oliver Eftevaag <[email protected]>
(cherry picked from commit 5c1d96b)
If we have a deep alias we need to bind to the inner object rather than
the outer one.

Fixes: QTBUG-109417
Change-Id: Iefe8641026cfbbf9199b2bb8d9fa2f5fba591f17
Reviewed-by: Fabian Kosmale <[email protected]>
(cherry picked from commit e9b7eaa)
Reviewed-by: Sami Shalayel <[email protected]>
Change-Id: Ia6afd11314a879e264198c73685dcd8886ca296e
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Change-Id: I3130254c32e47d2ca055c641cd0cef6f8705505d
Reviewed-by: Qt Submodule Update Bot <[email protected]>
A big advantage of PinchHandler over PinchArea is the ability to zoom
into a particular location in the target Item, so let's not fail to
show that off.

Change-Id: I0f22abff99bdc60bac27e72fd5f66be4796794df
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit e39b457)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Change-Id: Iab9599134113833cd9b63a7ae9d85e1f78577668
Reviewed-by: Qt Submodule Update Bot <[email protected]>
The C toupper/tolower functions are locale-dependent. Given the right
locale (Türkiye, e.g.), toupper(i) is either

- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)

Both results are wrong for the present use-case. Use the new
QtMiscUtils::toAsciiUpper() function instead.

Amends d481f2f.

Task-number: QTBUG-109235
Change-Id: Ib66593fc7eff3edc0cc16291ca3eae8bdf0dd8ed
Reviewed-by: Fabian Kosmale <[email protected]>
(cherry picked from commit 179200d)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Change-Id: I469c4f813f006ca47f9660a0c9ccfa30bbe89dc6
Reviewed-by: Laszlo Agocs <[email protected]>
(cherry picked from commit f92a2a6)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
Task-number: QTBUG-101736
Change-Id: Iecbe6b4da75851cb94c4c2bae41bb0cb50f0ed30
Reviewed-by: Volker Hilsheimer <[email protected]>
(cherry picked from commit 26cd43f)
A QQuickWidget contains a Quick UI, which can be expected to handle
touch events, and it handles touch events by forwarding them to the
QQuickWindow. So set the AcceptTouchEvents attribute and let the
Qt Quick delivery machinery deal with the touch-mouse synthesis
within the scene.

Also, Qt Quick's event delivery might return event points as ignored
after setting the exclusive grabber. Qt Widgets touch event delivery
logic doesn't care about exclusive grabbers, and relies on the event
points being accepted to make the widget that received the TouchBegin
an implicit grabber. QQuickWidget needs to translate those states back,
so accept all points that come back with a grabber.

Add a test that verifies that a button in a popup gets all events,
and that those events are translated correctly - without the fix,
the "clicked" test fails, as the release is delivered, but with
coordinates outside of the button.

Also test that we can have two QQuickWidgets where each gets one
touch point.

Fixes: QTBUG-101736
Change-Id: I3a2bf05fd297ae4d72b6e236ecd8e5ddac37ce06
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Paul Wicking <[email protected]>
(cherry picked from commit dc8f44b)
Reviewed-by: Volker Hilsheimer <[email protected]>
FriedemannKleint and others added 24 commits September 9, 2023 21:18
Adapt to qtbase/14f9f00fdb2dc428610c08e3d9d03e38e9602166, fixing:
sqlcontactmodel.cpp:40:13: warning: void QSqlQueryModel::setQuery(const QSqlQuery&) is deprecated: QSqlQuery is
 not meant to be copied. Pass it by move instead.
 [-Wdeprecated-declarations]

Change-Id: I88d7f30247876f55b0114785efcf4ce580de0ab8
Reviewed-by: Mitch Curtis <[email protected]>
(cherry picked from commit 3689e9c)
Reviewed-by: Ulf Hermann <[email protected]>
Probably we'll keep the Window and Screen example: it has walkthrough
docs already. Snippets can be used to illustrate some simplified
scenarios, while the example is a bit fancier.

Likewise, link to the Window and Screen example from the Screen docs.

Change-Id: I20c803affd1f4b6d44b41520782e5ad3c69fc871
Reviewed-by: Oliver Eftevaag <[email protected]>
(cherry picked from commit 36e3ea4)
Reviewed-by: Shawn Rutledge <[email protected]>
- Change the code that is quoted so that the indenting looks sane
- Make it possible to copy and run the first snippet without
  modification
- Make it easier to copy and run the second snippet without
  modification
- Move itemGrab.qml to item sub-directory
- Generally tidy up

Change-Id: I608b7a6025b9866c14b84420ae64827965a7519f
Reviewed-by: Paul Wicking <[email protected]>
(cherry picked from commit f0f9bac)
Reviewed-by: Ulf Hermann <[email protected]>
If the cursor configure feature is not enabled, don't build the code.

If the platform is Android or Wayland, skip the test.

Change-Id: Ic60771decf7f2e0bd7db77c112925147015af5a6
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
(cherry picked from commit fb22bc6)
Reviewed-by: Ulf Hermann <[email protected]>
During binding evaluation, it might happen that we do an initial read of
a deferred property. If that deferred property is in turn an object
property, further binding evaluations might occur. Those bindings should
not depend on whatever trigerred the initial binding evaluation.
However, with the new C++ properties/bindings, that would happen, as the
bindingStatus would still indicate that binding evaluation is active.

To remedy this, we temporarily suspend the binding status ind begin and
completeDeferred.

Fixes: QTBUG-96351
Change-Id: I7e9778aa5339f044ce3082e962a2ede34b5d1e69
Reviewed-by: Ulf Hermann <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
(cherry picked from commit 9b1d3a8)
Reviewed-by: Semih Yavuz <[email protected]>
QQmlDelegateModelPrivate::requestMoreIfNecessary() is called in various
situations, including at startup, which calls QAIM::fetchMore() on the
model if it supports that. But we need to do it in one more case:
when delegates are being reused from the cache, the model could provide
more rows even though we aren't instantiating new delegates.

Amends 1841a9e

Fixes: QTBUG-95107
Change-Id: I5b7ff48345ab78977cb03cfcf58ed96a57c831bd
Reviewed-by: Santhosh Kumar <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 589d0ee)
Reviewed-by: Sami Shalayel <[email protected]>
Parameterize the variable part of each section and include
each section as a snippet.

Change-Id: If5251cb2ee40dfb57cf57e0f1cad00b04c582e98
Reviewed-by: Nicholas Bennett <[email protected]>
(cherry picked from commit d33edd9)
Reviewed-by: Richard Moe Gustavsen <[email protected]>
It may not be clear that Qt::DisplayRole is used by default,
as this is only mentioned in textRole's documentation, which
isn't mentioned in the detailed description.

Change-Id: Ie7e16bbfbedc2de6cc336f3a548bf69d6dbbdf40
Reviewed-by: Nicholas Bennett <[email protected]>
(cherry picked from commit 9bd72f4)
Reviewed-by: Richard Moe Gustavsen <[email protected]>
QQuickPropertyAnimation does not own the targets in its targets list.
Thus, we need to be careful to not access deleted objects. Calling
QQmlData::wasDeleted is not enoguh, as the object might be fully
deleted, but we'd still have a dangling pointer to it.

Fix the issue by using QPointer. A similar issue might exists for
target, but there we don't normally end up with dangling references -
the engine will correctly null the target. And the QPointer isNull
check will avoid potentiall nullptr derefences there, too.

Ideally, we would use QQmlGuard instead of QPointer, as it would have a
lower overhead - however, we run into linker issues on MSVC. Fixing them
is deferred to a future commit, to not block this crash fix.

Fixes: QTBUG-100392
Change-Id: If084e2e0f22d50dbee8bf5aedfa2e749e79fc105
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Mitch Curtis <[email protected]>
(cherry picked from commit 8a74155)
Reviewed-by: Sami Shalayel <[email protected]>
When we use an attached object as an argument to a function call, we
need to properly extract it from the QmlTypeWrapper. Before this change,
we simpley left the argument pointer as null, which lead to subsequent
crashes when it got dereferenced.

Moreover, treat passing namespaces to functions expecting a QObject as a
TypeError, by returning false from CallArgument::fromValue (used to
crash for the same reason as with the attached object case).

Fixes: QTBUG-106119
Change-Id: Ifa6a32e20a29935aff1f265eb0edd3e35ea1c11b
Reviewed-by: Ulf Hermann <[email protected]>
(cherry picked from commit 84483bf)
Reviewed-by: Semih Yavuz <[email protected]>
If the user used for(let x;...) we need to preserve the let and must not
change it to var.

Fixes: QTBUG-105361
Change-Id: I49fc3797505b569cc9b8a9138dd57ec7e70d3eb9
Reviewed-by: Ulf Hermann <[email protected]>
(cherry picked from commit 84dd339)
pinchHandlerOnFlickable fail with QTBUG-112924.
Blacklist it for now.
It will be handled in QTBUG-113226

Task-number: QTBUG-113226
Task-number: QTBUG-112924
Change-Id: I58c646f957fb6f397405dc477d00eee770602e80
Reviewed-by: Richard Moe Gustavsen <[email protected]>
(cherry picked from commit 407675b)
Reviewed-by: Ulf Hermann <[email protected]>
Flickable is meant to be flicked with one finger, not two or more.
If the UI depends on using the pinch gesture on some child of the
contentItem, Flickable shouldn't interfere with that.

The user might accidentally touch the screen with extra fingers while
trying to flick; Flickable should not care, as long as it has grabbed
the one touchpoint that it's tracking before the second point appears.

Removes QEXPECT_FAILs added in d7623d7

handleMoveEvent() can be called from filterPointerEvent(), or from
mouseMoveEvent() in case of direct delivery; and filterPointerEvent()
will now avoid stealing the grab during multi-touch press or release as
well. The "ignoring multi-touch" categorized log message is emitted
twice while filtering a move event, but only once in the other cases.

Fixes: QTBUG-77629
Task-number: QTBUG-85278
Task-number: QTBUG-106223
Fixes: QTBUG-109655
Change-Id: I7a19deaed3b2255de2b686f0d96bd08fe5ab1636
Reviewed-by: Doris Verria <[email protected]>
(cherry picked from commit 5171bcd)
Reviewed-by: Shawn Rutledge <[email protected]>
More autotests should test mouse, especially touch and maybe tablet
events, with similar expectations, instead of testing mainly mouse and
mostly neglecting the other device types. This makes it easier to work
with data-driven tests that take specific QPointingDevice instances as
test data.

Started using them in tst_TapHandler::gesturePolicyDragWithinBounds()
which was already data-driven by device type. Clearly, this code is
now easier to read and less repetitious.

In tst_qquickwindow::subclassWithPointerEventVirtualOverrides() the
improvement is somewhat smaller, but this test validates that
tablet events are working.

Change-Id: I74d0fcc2f082af3737a0754c58205fa2b18c1a2d
Reviewed-by: Richard Moe Gustavsen <[email protected]>
(cherry picked from commit 59d967a)
Reviewed-by: Ulf Hermann <[email protected]>
…tive

Change-Id: Ib93661e86f3c9665ca0eb5071599672ac12ef67c
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Change-Id: I056b1fe67120dae4908d277793439603f848addb
Reviewed-by: Qt Submodule Update Bot <[email protected]>
This is basically the same as QTBUG-105204, only with the QML engine
being involved.

Fixes: QTBUG-104982
Change-Id: I5afaadedcd7af41198702a8f2331703b4f6ef2e7
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
(cherry picked from commit 2879c7c)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
…tive

Change-Id: Ia7c43f9ce31b81f014f8b843e2608440764bb3b4
Reviewed-by: Qt Submodule Update Bot <[email protected]>
When a data-driven test has
    QTest::addColumn<const QPointingDevice *>("device");
QTestData::append() does a type check with QTEST_ASSERT if it's not an
exact match. That can result in a crash, apparently, although it's not
clear then how 59d967a got through CI
the first time.

Amends 59d967a

Task-number: QTBUG-107863
Task-number: QTBUG-107864
Task-number: QTBUG-117079
Change-Id: I383191b604eb504d49b0d51a23ecc45160f3383b
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 1a8a47d)
Reviewed-by: Fabian Kosmale <[email protected]>
(cherry picked from commit 54227bc58abaa3ffd84150dfc80863035201d09f)
It crashes because of an assert: QPointingDevicePrivate::queryPointById() fails to find the expected eventpoint.

Task-number: QTBUG-117079
Change-Id: I85dcd7615cddc26d3c3adfe51473bb4074a1c925
Reviewed-by: Shawn Rutledge <[email protected]>
(cherry picked from commit 467563f33545d8cdc526b3f62a0a19bf49756896)
Change-Id: I553081d7166160c7cdca78076d884aea336a8c29
Reviewed-by: Qt Submodule Update Bot <[email protected]>
…2-opensource

Change-Id: Ib72ded968b7ac6b75b499392162e3cf3b761ec48
…tive

Change-Id: I01fa14ee2d130dd1be6024cd2a3679579def41d5
Reviewed-by: Qt Submodule Update Bot <[email protected]>
…tive

Change-Id: Ibea99ae074b4c4a4b6e34f71a9b7ae7986914399
Reviewed-by: Qt Submodule Update Bot <[email protected]>
qtprojectorg pushed a commit that referenced this pull request Dec 8, 2023
Using std::binary_search has the requirement that the passed
range fulfils ordering requirements, which was not the case
for the cppKeywords array here.

As the QString doc says [1]:

> QStrings can be compared using overloaded operators such as operator<(),
> operator<=(), operator==(), operator>=(), and so on. Note that
> the comparison is based exclusively on the numeric Unicode
> values of the characters. It is very fast, but is not what a
> human would expect; (...)

Therefore, sort the array accordingly and add an assert to
ensure it will remain sorted.

Fixes an crash/assert when building qtdeclarative with
CXXFLAGS='-D_GLIBCXX_DEBUG':

    /usr/include/c++/13/bits/stl_algo.h:2243:
    In function:
        bool std::binary_search(_FIter, _FIter, const _Tp&) [with _FIter = const
        QString*; _Tp = QStringView]

    Error: elements in iterator range [first, last) are not partitioned by the
    value __val.

    Objects involved in the operation:
        iterator "first" @ 0x7ffc4a2c4f18 {
          type = QString const* (constant iterator);
        }
        iterator "last" @ 0x7ffc4a2c4f10 {
          type = QString const* (constant iterator);
        }
    Aborted (core dumped)
    ninja: build stopped: subcommand failed.

GDB backtrace:

    Program terminated with signal SIGABRT, Aborted.
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    44      ./nptl/pthread_kill.c: No such file or directory.
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007f307e0a815f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
    #2  0x00007f307e05a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007f307e0444b2 in __GI_abort () at ./stdlib/abort.c:79
    #4  0x00007f307e2a300d in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
    #5  0x00005639ff90471d in std::binary_search<QString const*, QStringView> (__first=0x5639ffa1a9c0 <QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>,
        __last=0x5639ffa1b2c0 <guard variable for QmltcVisitor::checkForNamingCollisionsWithCpp(QDeferredSharedPointer<QQmlJSScope const> const&)::cppKeywords>, __val=...) at /usr/include/c++/13/bits/stl_algo.h:2243
    #6  0x00005639ff8fb837 in operator() (__closure=0x7ffc4a2c52bf, word=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:764
    #7  0x00005639ff8fb89e in operator() (__closure=0x7ffc4a2c52a0, name=..., errorPrefix=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:768
    #8  0x00005639ff8fc99b in QmltcVisitor::checkForNamingCollisionsWithCpp (this=0x7ffc4a2c6070, type=...) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:787
    #9  0x00005639ff8f9dea in QmltcVisitor::endVisit (this=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltcvisitor.cpp:341
    #10 0x00007f307f6636fa in QQmlJS::AST::UiProgram::accept0 (this=0x563a002e0628, visitor=0x7ffc4a2c6070) at /home/michi/development/git/qt5/qtdeclarative/src/qml/parser/qqmljsast.cpp:1193
    #11 0x00007f3080159b8f in QQmlJS::AST::Node::accept (this=0x563a002e0628, visitor=0x7ffc4a2c6070)
        at /home/michi/development/git/qt5/qtbase/include/QtQml/6.7.0/QtQml/private/../../../../../../qtdeclarative/src/qml/parser/qqmljsast_p.h:272
    #12 0x00007f3080212f4b in QQmlJSTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/src/qmlcompiler/qqmljstyperesolver.cpp:173
    #13 0x00005639ff8f0bd3 in QmltcTypeResolver::init (this=0x7ffc4a2c5b50, visitor=0x7ffc4a2c6070, program=0x563a002e0628) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/qmltctyperesolver.cpp:19
    #14 0x00005639ff8c02d4 in main (argc=23, argv=0x7ffc4a2c7a68) at /home/michi/development/git/qt5/qtdeclarative/tools/qmltc/main.cpp:269

[1] https://doc.qt.io/qt-6/qstring.html#comparing-strings

Change-Id: I82ebbcdca4ab90155b935f9af24b3a3821134563
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
Tarja Sundqvist and others added 5 commits February 20, 2024 10:05
…2-opensource

Conflicts solved in a file:
	dependencies.yaml

Change-Id: Ib4083daa41a689b937d2aeb522e93e3aab0be1c4
…tive

Change-Id: Iea77c0713e97dfaf8954134f78a8d07f804ed154
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Qt 6.2.9-lts release

Conflicts solved:
	dependencies.yaml

Change-Id: If2cf4ac99b3e70b6a875b00cc4c3e7766b361a08
…tive

Change-Id: Ib02444aca85e975eb2487eb71d32542dfe83eefe
Reviewed-by: Qt Submodule Update Bot <[email protected]>
Qt 6.2.10-lts release

Conflicts solved:
	dependencies.yaml

Change-Id: Ibdf006fa08cddc80ad30fb9ce1089305729d4ece
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.